<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2020/1/9
  Time: 9:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div>
    <form action="usersearch.jhtml" method="get">
        <div style="margin-top: 20px">
            姓名:<input type="text" name="name" value="${name}"/>
            开始时间<input type="text" name="startDate" value="<fmt:formatDate value="${start}" pattern="yyyy-MM-dd"></fmt:formatDate>"/>
            结束时间:<input type="text" name="endDate" value="<fmt:formatDate value="${end}" pattern="yyyy-MM-dd"></fmt:formatDate>"/>
            <input type="submit" value="搜索">
        </div>
    </form>
</div>
<a href="user-add.jsp">增加新用户</a>
<table border="1" cellspacing="0" cellpadding="0">
    <c:forEach var="user" items="${p.data}">
        <tr>
            <td>${user.id}</td>
            <td>${user.userName}</td>
            <td>${user.name}</td>
            <td>${user.telephone}</td>
            <td>${user.unit}</td>
            <td>${user.landMark}</td>
            <td><fmt:formatDate value="${user.enterdate}" pattern="yyyy年MM月dd日"/> </td>
            <td><a href="user-update-${user.id}.jhtml">修改</a></td>
            <td class="td-status">
                <a onclick="return confirm('您真的要删除吗？')" href="user-del-${user.id}.jhtml">删除</a>

            </td>
        </tr>
    </c:forEach>
</table>

<div>

    <div style="font-size: 23px">
        <a href="usersearch.jhtml?page=1&name=${name}&startDate=<fmt:formatDate value="${start}" pattern="yyyy-MM-dd"/>&endDate=<fmt:formatDate value="${end}" pattern="yyyy-MM-dd"/>">首页</a>
        <c:if test="${p.page>1}">
            <a href="usersearch.jhtml?page=${p.page-1}&name=${name}&startDate=<fmt:formatDate value="${start}" pattern="yyyy-MM-dd"/>&endDate=<fmt:formatDate value="${end}" pattern="yyyy-MM-dd"/>">上一页</a>
        </c:if>
        <c:if test="${p.totalPage>p.page}">
            <a href="usersearch.jhtml?page=${p.page+1}&name=${name}&startDate=<fmt:formatDate value="${start}" pattern="yyyy-MM-dd"/>&endDate=<fmt:formatDate value="${end}" pattern="yyyy-MM-dd"/>">下一页</a>
        </c:if>
        <a href="usersearch.jhtml?page=${p.totalPage}&name=${name}&startDate=<fmt:formatDate value="${start}" pattern="yyyy-MM-dd"/>&endDate=<fmt:formatDate value="${end}" pattern="yyyy-MM-dd"/>">尾页</a>
        <input type="number" min="1" value="${p.page}" id="go" style="width: 40px;height: 40px"/>
    </div>

</div>

</body>
</html>
